<?php get_header(); // mandamos llamar el header ?>
<div class="container">
	<div class="content-page">
	
	<div id="head-hide"></div>
	<div id="title-portafolio">
		<h1>PORTAFOLIO</h1>
	</div>
	<div id="content-bajada">
		<div class="jumbotron">
			<div id="text-cliente">
				<p class="lead">Cras justo odio, dapibus ac facilisis in, egestas eget quam. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
			</div>
			<div id="text-servicio">
				<p class="lead">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque lacinia, odio quis tempor condimentum, enim enim fringilla justo, non mollis est erat a ero snon mollis est erat a eros.</p>
			</div>
			<div id="text-plataforma">
				<p class="lead">Ut eu nisl semper, euismod quam sed, consequat diam. In viverra sagittis neque, luctus scelerisque metus pulvinar vel. Nulla nec purus in elit vulputate mattis ac ut mauris.</p>
			</div>
		</div>
	</div>
	<div class="row-fluid">
		<div id="content-servicios-cat">
			<div class="content-raya-cat"></div>
			<div class="span4">
				<div id="content-desc-cat">
					<a href="javascript:void(0)"><spam id="content-cliente">Clientes </spam></a>
					&nbsp;&nbsp;
					<a href="javascript:void(0)"><spam id="content-servicio">Servicios</spam></a>
					&nbsp;&nbsp;
					<a href="javascript:void(0)"><spam id="content-platafortma">Paltaformas Propias </spam></a>
				</div>
			</div>
			<div class="content-raya-cat-right"></div>
		</div>
	</div>
	<div class="row-fluid">
		<div id="menu" class="content-item-filter">
			<ul>
		<?php
			$cat = get_query_var('cat');
			$args=array(
				'parent'      => $cat
				);
			$categories=get_categories($args);
			foreach($categories as $category) { ?>
				<li class="<?php echo "li-".$category->slug; ?>">
					<a href="javascript:void(0)" rel="<?php echo $category->slug; ?>" class="nivel1" data-option-value=".<?php echo $category->slug; ?>"><p><?php echo $category->name; ?></p></a>
				</li>
		<?php }?>
				<li class="li-todos">
					<a href="javascript:void(0)" class="nivel1" rel="portafolio">Todas</a>
				</li>
				<li class="sin-class">
					<a href="javascript:void(0)" class="nivel1">&nbsp;</a>
				</li>
			</ul>
			
		</div>
	</div>
	
	<div class="row-fluid">
		<div id="content-load-cat-port"><img src="<?php  bloginfo( 'template_url' ); ?>/img/loader.gif"/></div>
			<div class="content-submenu">
				
			</div>
	</div>
	<div class="row-fluid">
		<div class="section-container clearfix">
				<div class="item-list clearfix" id="portafolio-items">
					<?php 
						$curr_cat = get_query_var('cat');
						$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
						$the_query = new WP_Query(array('cat'=>$curr_cat, 'paged'=>$paged));
						while ( $the_query->have_posts() ) :
							$the_query->the_post();	
							$post_categories = wp_get_post_categories($the_query->post->ID);
							$cats = array();
							$url = "";
							if ( get_post_meta($the_query->post->ID, 'url') ) $url = get_post_meta($the_query->post->ID, 'url',true);

							foreach($post_categories as $c) {
								$cat = get_category($c); if($cat->cat_ID != $curr_cat) $cats[] = $cat->slug;
							}
						?>
							<div class="span4 item<?php echo @count($cats) ? " ".@implode(" ", $cats) : ""?>">
								<div class="img-experto">
									<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><p><?php the_post_thumbnail();?></p></a>
								</div>
								<div class="titulo-portafolio"><a href="<?php the_permalink(); ?>"><?php echo get_the_title();?></a></div>
								<div class="extracto-portafolio"><?php the_excerpt();?></div>
								<div class="url-portafolio"><?php echo $url; ?></div>
								
								
							</div>
					<?php endwhile; ?>					
				</div>				
				<div id="page-nav">
				<?php next_posts_link(); ?>
			</div>
				
			</div>	
	</div>
	
	
	
	</div>
</div>
<?php get_footer(); // mandamos llamar el footer ?>
